package cn.cy.pojo;

import cn.cy.util.Constants;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ClaimVoicherCondition {
    //状态
    private String status;
    //起始日期
    private Date start;
    //截止日期
    private Date end;
    // 页面大小,即每页显示记录数
    private Integer pageSize = Constants.pageSize;
    // 当前页号
    private Integer currPageNo = 1;
    // 总页数
    private Integer totalPageCount;
    // 记录总数
    private Long totalCount;


    public Integer getPageSize() {
        return pageSize;
    }

    public Integer getCurrPageNo() {
        return currPageNo;
    }

    public void setCurrPageNo(Integer currPageNo) {
        this.currPageNo = currPageNo;
    }

    public Integer getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(Integer totalPageCount) {
        this.totalPageCount = totalPageCount;
    }

    public Long getTotalCount() {
        return totalCount;
    }
    //获取总记录数，并算出总页数
    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
        if (totalCount >= 0) {
            Long count = totalCount / pageSize;
            if (totalCount % pageSize > 0) {
                count++;
            }
            this.totalPageCount = Integer.parseInt(count.toString());
        }
    }

    @Override
    public String toString() {
        return "ClaimVoicherCondition{" +
                "status='" + status + '\'' +
                ", start=" + start +
                ", end=" + end +
                ", pageSize=" + pageSize +
                ", currPageNo=" + currPageNo +
                ", totalPageCount=" + totalPageCount +
                ", totalCount=" + totalCount +
                '}';
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }
}
